export const schema = {
    title: "团队资料页",
    initApi: "get:/api/user/team",
    toolbar: {
        type: "button",
        actionType: "submit",
        label: "保存",
        icon: "fa fa-save pull-left",
        level: "primary",
        target: "theform"
    },
    body: [
        {
            visibleOn: 'data.verify_status == -1',
            type: 'tpl',
            tpl: `<div class="alert alert-warning">请先完善资料</div>`
        },
        {
        type: "form",
        name: 'theform',
        mode: "horizontal",
        redirect: '/home',
        api: "post:/api/user/team",
        title: "",
        actions: [
            {
                type: 'submit',
                primary: true,
                label: "保存",
                icon: "fa fa-save pull-left",
            }
        ],
        controls: [


            {
                type: "text",
                name: "name",
                label: "团队名称",
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "select",
                name: "type",
                label: "团队类型",
                required: true,
                source: "/api/setting/team_type"
            },

            {
                type: "divider"
            },

            {
                type: "checkboxes",
                columnsCount: 4,
                name: "service_target",
                label: "服务对象",
                required: true,
                source: "/api/setting/service_target"
            },

            {
                type: "divider"
            },

            [
                {
                    type: "text",
                    name: "contact_name",
                    label: "联系人",
                    required: true
                },

                {
                    type: "text",
                    name: "contact_phone",
                    label: "联系电话",
                    validations: 'isPhone',
                    required: true
                }
            ],

            {
                type: "divider"
            },

            {
                type: "text",
                name: "contact_email",
                label: "邮箱",
                validations: 'isEmail',
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "region",
                name: "address",
                label: "团队地址",
                required: true
            },


            {
                type: "divider"
            },

            {
                type: "text",
                name: "slogan",
                label: "团队口号",
                maxLength: 128
            },

            {
                type: "divider"
            },

            {
                type: "textarea",
                name: "abstract",
                label: "团队简介",
                required: true
            },

            {
                type: "divider"
            },

            {
                type: "image",
                name: "logo",
                label: "Logo",
                // accept: "image/png,image/jpeg",
                maxSize: 10 * 1024 * 1024,
                desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M，建议尺寸比例：（60 x 60）。',
                limit: {
                    minWidth: 60,
                    minHeight: 60,
                    maxwidth: 900,
                    maxHeight: 900
                }
            },

            {
                type: "divider"
            },

            {
                type: "image",
                name: "certificate_photo",
                // accept: "image/png,image/jpeg",
                label: "上传资质",
                maxSize: 10 * 1024 * 1024,
                desc: '上传资质文件做个说明，请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。建议尺寸比例：（750 x 440）。',
                multiple: true,
                maxLength: 5
            },
            {
                type: "divider"
            },

            {
                type: "image",
                name: "team_photo",
                label: "上传团队照片",
                // accept: "image/png,image/jpeg",
                maxSize: 10 * 1024 * 1024,
                desc: '请选择 jpg 或者 png 图片，单个文件请不要超过 10M，最多可上传5张。建议尺寸比例：（750 x 440）。',
                maxLength: 5,
                multiple: true
            },



            {
                type: "divider"
            },

            {
                type: "static",
                name: "username",
                label: "帐号"
            }
        ]
    }]
};
